type 'a id = int
type t = {
	id: int;
	data: Obj.t;
}

let gen_id =
	let _id = ref 0 in
	fun () ->
		let id = !_id in
		incr _id; id

let box id data =
	{ id = id; data = Obj.repr data }

let unbox id cell =
	if id = cell.id then Some (Obj.obj cell.data) else None
